#include<bits/stdc++.h>
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define rept(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) rept(i,0,n)
#define all(a) a.begin(),a.end()
#define sz(a) ((int)a.size())
#define il inline
#define db double
#define ld long double
#define re return
#define F first
#define S second
#define int long long
using namespace std;
template<typename T>void Mx(T &a,T b){if(a<b)a=b;}
template<typename T>void Mi(T &a,T b){if(a>b)a=b;}
const int MOD=998244353;
const int INF=1000000000000000000;
void FILEIO(string s){
    freopen((s+".in").c_str(),"r",stdin);
    freopen((s+".out").c_str(),"w",stdout);
}
void run(){
    int n;
    cin>>n;
    vi v(n);
    rep(i,n)cin>>v[i];
    sort(all(v));
    int las=0,cnt=0;
    rep(i,n){
        if(i&&v[i]>v[i-1]){
            las+=cnt;cnt=0;
        }
        if(las)las--;cnt++;
    }
    cout<<las+cnt<<"\n";
}
signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    FILEIO("duel");
    int T=1;
    // cin>>T;
    while(T--)run();
    re 0;
}